<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>

<h2><?php print $header?></h2>
<p><?php echo $this->lang->line( 'article_intro' ); ?></p>
<div class="buttons">                
	<a href="<?php print site_url( 'article/user/article/form' )?>">
    <?php print $this->bep_assets->icon( 'add' );?>
    <?php print $this->lang->line( 'create_article' )?>
    </a>
</div>
<br />
<br />
<br />
<?php print form_open('article/user/article/delete')?>
<table class="data_grid" cellspacing="0">
    <thead>
        <tr>
            <th><?php print $this->lang->line( 'article_title' )?></th>
            <th><?php print $this->lang->line( 'article_category' )?></th>
            <th><?php print $this->lang->line( 'article_position' )?></th>
            <th width=5% class="middle"><?php print $this->lang->line( 'article_active' )?></th> 
            <th width=5% class="middle"><?php print $this->lang->line( 'article_edit' )?></th>
            <th width=5% class="middle"><?php print $this->lang->line( 'article_translate' )?></th>
            <th width=10%><?php print form_checkbox( 'all', 'select', FALSE)?><?php print $this->lang->line( 'article_delete' )?></th>        
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan=5>&nbsp;</td>
            <td><?php print form_submit( 'delete', $this->lang->line( 'article_delete' ), 'onClick="return confirm(\''.$this->lang->line('article_delete_confirm').'\');"')?></td>
        </tr>
    </tfoot>
    <tbody>
        <?php foreach( $articles->result_array( ) as $row ){ ?>
        <tr>
            <td><?php print $row['article_title']?></td>
            <td><?php print $row['name'] ?></td>
            <td><?php print $row['position']?></td>
            <td class="middle"><!-- <?php print img($this->config->item('shared_assets').'icons/'.($row['active']?'tick':'cross').'.png')?>--></td> 
            <td class="middle"><a href="<?php print site_url('article/user/article/form/'.$row['id'])?>"><?php print $this->bep_assets->icon( 'pencil' ) ?></a></td>
            <td class="middle"><a href="<?php print site_url('article/user/article/translate/'.$row['id'].'/2')?>"><?php print $this->bep_assets->icon( 'flag-gb' ) ?></a></td>
            <td><?php print form_checkbox( 'select[]', $row['id'], FALSE ); ?></td>
        </tr>
        <?php } //foreach ?>
    </tbody>
</table>
<?php print form_close()?>